package com.newlink.building.login.mvp.contract

import android.content.Context
import com.newlink.building.common_base.base.IModel
import com.newlink.building.common_base.base.IPresenter
import com.newlink.building.common_base.base.IView
import com.newlink.building.common_base.model.bean.HttpResult
import com.newlink.building.common_base.model.bean.KitDeviceData
import com.newlink.building.common_base.model.bean.KitRegisterRequest
import com.newlink.building.common_base.model.bean.RegisterData
import com.newlink.building.common_base.model.bean.RegisterResultData
import com.newlink.building.common_base.model.bean.ResponseTopData
import com.newlink.building.common_base.model.bean.VerifyCodeRequest
import io.reactivex.Observable

/**
 * Created by xiaodong on 2022/8/24.
 */
interface Module_Login_RegisterContract {

    interface View : IView {
        fun registerSuccess(data: RegisterResultData)
        fun registerFail()
        fun getVerifyCodeSuccess(success: Boolean)
    }

    interface Presenter : IPresenter<View> {
        fun register(user: String, password: String)
        fun kitRegister(request: KitRegisterRequest)
        fun getVerifyCode(request: VerifyCodeRequest)
        fun startBrowser(context: Context, url: String)
        fun getKitDeviceDataFromQrcode(qrcode: String): ArrayList<KitDeviceData>
    }

    interface Model : IModel {
        fun register(user: String, password: String): Observable<HttpResult<RegisterData>>
        fun kitRegister(request: KitRegisterRequest): Observable<HttpResult<RegisterResultData>>
        fun getVerifyCode(request: VerifyCodeRequest): Observable<HttpResult<ResponseTopData>>
    }

}